From: Florian Müllner Date: Tue, 16 Oct 2012 19:32:05 +0000 (+0200) Subject: loginScreen: Add support for 'disable-restart-buttons' X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5590 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=86c85a752eacf4f89d8d5ca5ef1000692385c1af;p=gnome-shell.git loginScreen: Add support for 'disable-restart-buttons' GDM's GSettings schema contains a 'disable-restart-buttons' key that currently is only supported by the fallback greeter. Implement support in the shell greeter as well. https://bugzilla.gnome.org/show_bug.cgi?id=686247 --- diff --git a/js/gdm/powerMenu.js b/js/gdm/powerMenu.js index b57eec5cb..bf545c13b 100644 --- a/js/gdm/powerMenu.js +++ b/js/gdm/powerMenu.js @@ -18,11 +18,13 @@ * 02111-1307, USA. */ +const Gio = imports.gi.Gio; const Lang = imports.lang; const UPowerGlib = imports.gi.UPowerGlib; const LoginManager = imports.misc.loginManager; +const GdmUtil = imports.gdm.util; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; @@ -37,6 +39,10 @@ const PowerMenuButton = new Lang.Class({ this._loginManager = LoginManager.getLoginManager(); + this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA }); + this._settings.connect('changed::disable-restart-buttons', + Lang.bind(this, this._updateVisibility)); + this._createSubMenu(); this._upClient.connect('notify::can-suspend', @@ -58,7 +64,7 @@ const PowerMenuButton = new Lang.Class({ _updateVisibility: function() { let shouldBeVisible = (this._haveSuspend || this._haveShutdown || this._haveRestart); - this.actor.visible = shouldBeVisible; + this.actor.visible = shouldBeVisible && !this._settings.get_boolean('disable-restart-buttons'); }, _updateHaveShutdown: function() {